import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:moose_app/ui/values/values.dart';
import 'package:moose_app/ui/widgets/scroll/scroller_configuration_wrapper.dart';

import 'food_item.dart';

/// 美食
class ATHFoodContent extends StatefulWidget {
  @override
  _ATHFoodContentState createState() => _ATHFoodContentState();
}

class _ATHFoodContentState extends State<ATHFoodContent> {
  @override
  Widget build(BuildContext context) {
    return ATHScrollerConfigurationWrapper(
      child: Container(
        margin: EdgeInsets.symmetric(horizontal: kSize20),
        child: StaggeredGridView.countBuilder(
            padding: EdgeInsets.only(top: kSize10),
            shrinkWrap: true,
            primary: false,
            crossAxisCount: 4,
            itemCount: 10,
            mainAxisSpacing: kSize20,
            crossAxisSpacing: kSize20,
            staggeredTileBuilder: (index) {
              return StaggeredTile.fit(2);
            },
            itemBuilder: (context, index) {
              return ATHFoodItem();
            }),
      ),
    );
  }
}
